package com.atguigu.practice;
public class IsSymmetric {
    public boolean isSymmetric(BinaryTree.TreeNode root) {
        if(root==null)return true;
        return isSymmetric(root.left,root.right);
    }
    public boolean isSymmetric(BinaryTree.TreeNode left, BinaryTree.TreeNode right){
        if(left==null && right==null){
            return true;
        }
        if(left==null || right==null){
            return false;
        }
        if(left.val==right.val){
            return isSymmetric(left.left,right.right) && isSymmetric(left.right,right.left);
        }
        return false;
    }
}
